﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/FullSite.Master" Inherits="System.Web.Mvc.ViewPage<ToppingControl.Models.TopCordPlanModel.TopCordPlan_DS>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Header_RuN</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="float-left">
      <h2>
         Topping Head Computer</h2>
   </div>
   <div class="float-right">
      <div class="float-left">
         <h3>
            Topping NO.
            <%: Html.DisplayFor(model => model._Topno) %>
         </h3>
      </div>
      <div class="float-left" style="margin-left: 25px;">
         <h3>
            Shift :   <%: ViewBag.shift %></h3>
      </div>
      <div class="float-left" style="margin-left: 25px;">
         <h3>
            Name :
            <% if (Request.IsAuthenticated)
               { %>
            <%:  User.Identity.Name %></h3>
      </div>
      <% } %>
   </div>
   <style type="text/css">
       #finish,#run
       {
           background-color:Red;
       }
      .fontTB
      {
         font-size: 18pt !important;
      }
      #txtComp
      {
         font-size: 1em;
         height: 2em;
         line-height: 2.5em;
      }
           .btn
      {
         font-size: 24px !important;
       
      }
      .ui-widget-header {
    background: url("images/ui-bg_gloss-wave_35_f6a828_500x100.png") repeat-x scroll 50% 50% #F6A828;
    border: 1px solid #E78F08;
    color: #FFFFFF;
    font-weight: bold;
}
      /* Bigger text */</style>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="FeaturedContent" runat="server">

</asp:Content>



<asp:Content ID="Content5" ContentPlaceHolderID="MainContent2" runat="server">
    <br />
   <% 
      string Itemno = "";
      if (WinNemoLib.StrUtil.IsNotEmpty(Model._Itemno))
      {
         Itemno = Model._Plandt + '-' + Model._Itemno;

      } %>
    <% if (WinNemoLib.StrUtil.IsNotEmpty(Model._Runflag))
       { %>
       <table width=75% style="height:75%">
    <%}
       else
       { %> 
            <table width=75% style="height:82%">
    <%} %>
      <tr class="rowb">
         <td class="head cell text-right" style="padding: 10px 0px; width: 35%;">
            SEQ
         </td>
         <td class="cell" id="seqDT">
            <%= Itemno %>
         </td>
      </tr>
      <tr class="rowb">
         <td class="head cell text-right" style="padding: 10px 0px;">
            Topped Cord
         </td>
         <td class="cell">
            <%= Model._Topcrdcd%>
         </td>
      </tr>
      <tr class="rowb">
         <td class="head cell text-right" style="padding: 10px 0px;">
            Manufacturer
         </td>
         <td class="cell">
            <%= Model._Manufc %>
         </td>
      </tr>
      <tr class="rowb">
         <td class="head cell text-right" style="padding: 10px 0px;">
            Length (M.)
         </td>
         <td class="cell">
            <%= Model._Length%>
         </td>
      </tr>
      <tr class="rowb">
         <td class="head cell text-right" style="padding: 10px 0px;">
            Tire Cord
         </td>
         <td class="cell" id="code">
            <%= Model._Tcrdcd %>
         </td>
      </tr>
      <tr class="rowb">
         <td class="head cell text-right" style="padding: 10px 0px;">
            Tire Cord Lot
         </td>
         <td class="cell" id="lot">
            <%=Model._Tcrdlot %>
         </td>
      </tr>
      <tr class="rowb">
         <td class="head cell text-right" style="padding: 10px 0px;">
            Tire Cord Expire
         </td>
         <td class="cell" id="exp">
            <%=Model._Tcrdexp %>
         </td>
      </tr>
      <tr class="rowb">
         <td class="head cell text-right" style="padding: 10px 0px;">
            Tire Cord Tag Length (M.)
         </td>
         <td class="cell">
            <%=Model._Tcrdtagl %>
         </td>
      </tr>
      <tr class="rowb">
         <td class="head cell text-right" style="padding: 10px 0px;">
            Tire Cord Tag Width (cm.)
         </td>
         <td class="cell">
            <%=Model._Tcrdtagw %>
         </td>
      </tr>
      <tr class="rowb">
         <td class="head cell text-right" style="padding: 10px 0px;">
            Tire Cord Width (cm.)
         </td>
         <td class="cell">
            <%=Model._Tcrdw %>
         </td>
      </tr>
      <tr class="rowb">
         <td class="head cell text-right" style="padding: 10px 0px;">
            Compound
         </td>
         <td class="cell" id="mComp">
            <%=Model._Compcd %>
         </td>
      </tr>
      <tr class="rowb">
         <td class="head cell text-right" style="padding: 10px 0px;">
            Compound Lot
         </td>
         <td class="cell" id="comp">
            <%=Model._Complot %>
         </td>
      </tr>
            <tr class="rowb">
         <td class="head cell text-right" style="padding: 10px 0px;">
            Compound Pallet
         </td>
         <td class="cell" id="Td1">
            <%=Model._Comppllt %>
         </td>
      </tr>
                  <tr class="rowb">
         <td class="head cell text-right" style="padding: 10px 0px;">
            Compound Expired
         </td>
         <td class="cell" id="Td2">
            <%=Model._Compexp %>
         </td>
      </tr>
         <tr class="rowb">
         <td class="head cell text-right" style="padding: 10px 0px;">
            Compound (Kg.)
         </td>
         <td class="cell" id="Td3">
            <%=Model._Compw %>
         </td>
    </tr>
   
   </table>
   
 <% if (WinNemoLib.StrUtil.IsNotEmpty(Model._Runflag))
       { %><table width=75%>
    <tr><td colspan="2">  <div id="progressbar"></div></td></tr>
    </table>
    <%}  %>

</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="TableContent" runat="server">
    <% if (WinNemoLib.StrUtil.IsNotEmpty(Model._Runflag))
       { %>
         <div class="float-left" style="margin: 15px;">
         <input id="finish" type="button" value="FINISH" class="btnFooter" style="height: 75px; width: 350px;" />
         </div>            
         <div class="float-right" style="margin:15px;">
<input type="button" id="com" value="Change Compound" class="btnFooter shadow" style="height: 75px; width: 350px;" />
</div>
    <%} else { %>     
         
     <div class="float-left" style="margin: 15px;">
         <input id="back" type="button" value="BACK" class="btnFooter shadow"  style="height: 75px; width: 350px;" />
      </div>
<div class="float-right" style="margin:15px;">
<input type="button" id="run" value="RUN" class="btnFooter shadow" style="height: 75px; width: 350px;" />
</div>
      
      <% } %>


</asp:Content>

<asp:Content ID="Content6" ContentPlaceHolderID="ScriptsSection" runat="server">
    <style type="text/css">
#run,#finish
{
    color:Black;
}
#run:hover,#finish:hover
{
    color:White;
}
</style>
    <% if (false)
      { %>
   <script src="../../Scripts/jquery-1.7.2.js" type="text/javascript"></script>
   <% } %>
   <script type="text/javascript">
      function updateProgress() {
         var progress;
         progress = $("#progressbar")
         .progressbar("option", "value");
         if (progress < 100) {
            $("#progressbar")
            .progressbar("option", "value", progress + 1);
            setTimeout(updateProgress, 500);
         }
         else {
            $("#progressbar").progressbar({ value: 0 });
            setTimeout(updateProgress, 500);
         }
      }
      $(function () {
          $("#progressbar").progressbar({ value: 0 });
          setTimeout(updateProgress, 500);

          $("#back").click(function () {
              var url = '<%= Url.Action("Header_des_com","HeaderLine") %>' + '?seq=' + $.trim($("#seqDT").text()) + "&st=A1";
              window.location = url;
          });
          $("#run").click(function () {
              var getUsersUrl = '<%=Url.Action("Upd_Status","HeaderLine") %>';
              var action = '<%= Url.Action("Header_RuN","HeaderLine") %>' + '?seq=' + $.trim($("#seqDT").text());
              callScriptMethod(getUsersUrl, { seq: $.trim($("#seqDT").text()), status: 'R' }, action);
          });
          $("#finish").click(function () {
              var getUsersUrl = '<%=Url.Action("Upd_Status","HeaderLine") %>';
              var action = '<%= Url.Action("Header_line","HeaderLine") %>'
              callScriptMethod(getUsersUrl, { seq: $.trim($("#seqDT").text()), status: 'F' }, action);
          });
          $("#com").click(function () {
              var getUsersUrl = '<%=Url.Action("CPC_CHANGE","CPD_USE") %>' + '?seq=' + $.trim($("#seqDT").text())            
              window.location = getUsersUrl;
            
          });
          /********* AJAX ********/

          function callScriptMethod(url, jsonObject, action, callback, async) {
              callback = callback || function () { };
              async = (async == null || async);

              $.ajax({
                  type: "POST",
                  contentType: "application/json; charset=utf-8",
                  url: url,
                  data: JSON.stringify(jsonObject),
                  dataType: "json",
                  async: async,
                  success: function (data) {

                      if (data.success != "0") {
                          window.location = action;
                      } else alert(data.message);
                  },
                  error: function (xhr, status, error) {
                      var err = xhr.responseText;
                      alert(err.Message);
                  }
              });
          }

      });

     
   </script>
</asp:Content>
